import {
    createRouter,
    createWebHashHistory
} from 'vue-router'

// 子路由
const childrenRouter = [{
        path: '',
        name: 'default',
        component: () => import('@/views/index/index.vue')
    },
    {
        path: '/index',
        name: 'index',
        component: () => import( /* webpackChunkName: "index" */ '@/views/index/index.vue')
    }
]

const routes = [{
    path: '/',
    name: 'layout',
    component: () => import('@/views/layout/index.vue'),
    children: childrenRouter,
    meta: {
        title: '首页'
    }
}, ]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router